import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useUserStore = defineStore(
  'user',
  () => {
    const userInfo = ref({})
    const setUserInfo = (info) => (userInfo.value = info)
    const removeUserInfo = () => {
      userInfo.value = {}
    }
    return { userInfo, setUserInfo, removeUserInfo }
  },
  {
    persist: true
  }
)
